Fix the bug that hvm domain network breaks after xm reboot. Root
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 14 Mar 2006 14:40:44 +0000 (15:40 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 14 Mar 2006 14:40:44 +0000 (15:40 +0100)
cause: qemu network related info is not saved in xenstore, so after
reboot, this information is missing, and qemu can not start network.

Signed-off-by: Haifeng Xue <haifeng.xue@intel.com>
tools/python/xen/xend/server/netif.py

index ebb7212534aa0596d2787f3e5d8579308f68b1e1..028bbf3989072034a3683b67cf257d4f64cfa2d8 100644 (file)
@@ -72,8 +72,6 @@ class NetifController(DevController):
                               sxp.child_value(config, 'script',
                                               xroot.get_vif_script()))
         typ = sxp.child_value(config, 'type')
-        if typ == 'ioemu':
-            return (None,{},{})
         bridge  = sxp.child_value(config, 'bridge')
         mac     = sxp.child_value(config, 'mac')
         vifname = sxp.child_value(config, 'vifname')
@@ -87,6 +85,13 @@ class NetifController(DevController):
         back = { 'script' : script,
                  'mac'    : mac,
                  'handle' : "%i" % devid }
+
+        if typ == 'ioemu':
+            front = {}
+            back['type'] = 'ioemu'
+        else:
+            front = { 'handle' : "%i" % devid,
+                      'mac'    : mac }
         if ipaddr:
             back['ip'] = ' '.join(ipaddr)
         if bridge:
@@ -94,9 +99,6 @@ class NetifController(DevController):
         if vifname:
             back['vifname'] = vifname
 
-        front = { 'handle' : "%i" % devid,
-                  'mac'    : mac }
-
         return (devid, back, front)